let {
    datas
} = require("./data_shema");
let {
    user
} = require("../login/sign_schma");
let {integralAward} = require("../integral/awaed_schema");
module.exports = {
    //添加说说奖励15积分
    addFun: function (req, res, err) {
        let find = req.body.user
  
        datas.create(req.body).then(() => {
    
            user.find({user:find}).then((u)=>{
                let integral = u[0].integral + 15;
                integralAward.create({user:find,time:req.body.createTime,changeIntegral:integral,caseOf:"发表说说"});
               
                user.updateOne({user:find},{$set:{integral}}).then((s)=>{
                    console.log(s,123);
                })
            })
            res.send(true);
        })
    }
}